﻿package
{
    import com.purplemovies.display.ExtContentController;
	import flash.text.TextField;
	import flash.ui.Keyboard;
	import flash.display.StageDisplayState;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	
	import flash.display.Sprite;
	public class Main extends Sprite {
		
	// CONSTRUCTOR:
		function Main() {
			var tf:TextField = new TextField();
			tf.scaleX = tf.scaleY = 4;
			tf.selectable = false;
			tf.autoSize   = 'left';
			tf.text       = 'HIT ALT + F4 TO EXIT';
			addChild( tf );
			
            addEventListener(Event.ADDED_TO_STAGE, onAdded );
		}
		
	// METHODS:
        protected function onAdded( e:Event ):void
        {
            trace( parent.manifest );
            
			stage.displayState = StageDisplayState.FULL_SCREEN;
			stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown );
        }
		
		protected function onKeyDown(e:KeyboardEvent):void
        {
			switch ( e.keyCode ) {
				case Keyboard.ESCAPE : stage.displayState = StageDisplayState.FULL_SCREEN; break;
			}   
		}
		
	}
}